Type Inference for Java 5 Wildcards, F-Bounds, and Undecidability

نویسندگان

  • Karl Mazurak
  • Steve Zdancewic
چکیده

We consider the problem of type checking for Java 5 with generics and wildcard types. Java supports type inference for methods with type parameters, but its presentation in the Java Language Specification lacks both clarity and a sense for how inference fits into the larger picture of Java’s type system. We show, in contrast, how this type inference can be cleanly integrated with subtyping of wildcard types, justifying the intuitions of programmers and logicians alike. In addition, we examine the decidability of Java typechecking and identify key points in the subtyping relation that both lead to undecidability and suggest a decidable conservative approximation.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Programme Chair Programme Committee External Reviewers Session 2. Languages and Verification Session 3. Analysis towards an Existential Types Model for Java Wildcards

Wildcards extend Java generics by softening the mismatch between subtype and parametric polymorphism. Although they are a key part of the Java 5.0 programming language, a type system including wildcards has never been proven type sound. Wildcards have previously been formalised as existential types. In this paper we extend FGJ, a featherweight formalisation of Java with generics, with existenti...

متن کامل

Towards an Existential Types Model for Java Wildcards

Wildcards extend Java generics by softening the mismatch between subtype and parametric polymorphism. Although they are a key part of the Java 5.0 programming language, a type system including wildcards has never been proven type sound. Wildcards have previously been formalised as existential types. In this paper we extend FGJ, a featherweight formalisation of Java with generics, with existenti...

متن کامل

A Model for Java with Wildcards

Wildcards are a complex and subtle part of the Java type system, present since version 5.0. Although there have been various formalisations and partial type soundness results concerning wildcards, to the best of our knowledge, no system that includes all the key aspects of Java wildcards has been proven type sound. This paper establishes that Java wildcards are type sound. We describe a new for...

متن کامل

Java Type Unification with Wildcards

With the introduction of Java 5.0 the type system has been extended by parameterized types, type variables, type terms, and wildcards. As a result very complex types can arise. The term Vector>> is for example a correct type in Java 5.0. In this paper we present a type unification algorithm for Java 5.0 type terms. The algorithm unifies type terms, which a...

متن کامل

The Undecidability of Type Related Problems in Type-free Style System F

We consider here a number of variations on the System F, that are predicative second-order systems whose terms are intermediate between the Curry style and Church style. The terms here contain the information on where the universal quantifier elimination and introduction in the type inference process must take place, which is similar to Church forms. However, they omit the information on which ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006